package com.yiyuan.app.controller;

import com.guaike.core.entity.result.Result;
import com.yiyuan.app.service.HomeService;
import com.yiyuan.app.entity.result.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/home")
@Api(tags = "首页相关接口组")
@AllArgsConstructor
public class HomeController {

    private final HomeService homeService;

    @GetMapping("/user/info")
    @ApiOperation(value = "用户信息")
    public Result<HomeUserInfoVO> userInfo() {
        return homeService.userInfo();
    }

    @GetMapping("/notice/list")
    @ApiOperation(value = "系统公告列表")
    public Result<List<NoticeVO>> noticeList() {
        return homeService.noticeList();
    }

    @GetMapping("/banner/info")
    @ApiOperation(value = "首页轮播图")
    public Result<BannerVO> bannerInfo() {
        return homeService.bannerInfo();
    }

    @GetMapping("/getNewUserPackage")
    @ApiOperation(value = "查询新手大礼包套餐")
    public Result<NoviceGiftPackVO> getNewUserPackage() {
        return homeService.getNewUserPackage();
    }

    @GetMapping("/getGiftPackage")
    @ApiOperation(value = "查询礼包")
    public Result<GiftPackVO> getGiftPackage() {
        return homeService.getGiftPackage();
    }

    @GetMapping("/checkRealNameButton")
    @ApiOperation(value = "查询实名认证开关，true代表开启实名认证，false代表关闭")
    public Result<Boolean> checkRealNameButton() {
        return homeService.checkRealNameButton();
    }
}
